import { createWebHashHistory, createRouter } from "vue-router";
import LoginView from "../pages/login/index.vue";
import Layout from "../components/layout/index.vue";
import { redirectUrl } from "./redirect";

const routes = [
  { path: "/", redirect: "/login" },
  { path: "/login", component: LoginView },
  {
    path: "/",
    component: Layout,
    children: [
      {
        path: "/redirect",
        name: "Redirect",
        meta: {
          title: "Redirect",
          tabActive: "0",
        },
        component: () => import("../pages/redirect/index.vue"),
      },
      {
        path: "/sysset_home/basic",
        name: "系统配置-首页",
        meta: {
          title: "系统配置-首页",
          tabActive: "1",
          hideBg: true,
        },
        component: () => import("../pages/sysset_home/basic/index.vue"),
      },
      {
        path: "/sysset_home/menuConfig",
        name: "菜单管理",
        meta: {
          title: "菜单管理",
          tabActive: "1",
        },
        component: () => import("../pages/sysset_home/menuConfig/index.vue"),
      },
      {
        path: "/manage_product/goods_list",
        name: "商品列表",
        meta: {
          title: "商品列表",
          tabActive: "2",
        },
        component: () => import("../pages/manage_product/goods_list/index.vue"),
      },
      {
        path: "/manage_product/goods_release",
        name: "发布商品",
        meta: {
          title: "发布商品",
          titleZhCN: "发布商品",
          titleEnUS: "Publish Product",
          titleKz: "Тауар шығару",
          titleRuRU: "Публикация товара",
          tabActive: "2",
          parent: "/manage_product/goods_list",
        },
        component: () =>
          import("../pages/manage_product/goods_list/release.vue"),
      },
      {
        path: "/manage_product/goods_list/detail",
        name: "商品详情",
        meta: {
          title: "商品详情",
          tabActive: "2",
          parent: "/manage_product/goods_list",
          titleZhCN: "商品详情",
          titleEnUS: "Product Details",
          titleKz: "Тауар егжей-тегжейі",
          titleRuRU: "Детали товара",
        },
        component: () => import("../pages/manage_product/goods_list/detail.vue"),
      },
      {
        path: "/manage_product/coupon",
        name: "平台优惠券",
        meta: {
          title: "平台优惠券",
          tabActive: "2",
          keepAlive: true
        },
        component: () => import("../pages/manage_product/coupon/index.vue"),
      },
      {
        path: "/manage_product/coupon/detail",
        name: "优惠券详情",
        meta: {
          title: "优惠券详情",
          tabActive: "2",
          parent: "/manage_product/coupon",
          titleZhCN: "优惠券详情",
          titleEnUS: "Coupon Details",
          titleKz: "Купон егжей-тегжейі",
          titleRuRU: "Детали купона",
        },
        component: () => import("../pages/manage_product/coupon/detail.vue"),
      },
      {
        path: "/manage_product/store_coupon",
        name: "店铺优惠券",
        meta: {
          title: "店铺优惠券",
          tabActive: "2",
          keepAlive: true
        },
        component: () =>
          import("../pages/manage_product/store_coupon/index.vue"),
      },
      {
        path: "/manage_product/store_coupon/add",
        name: "发布优惠券",
        meta: {
          title: "发布优惠券",
          tabActive: "2",
          parent: "/manage_product/store_coupon",
          titleZhCN: "发布优惠券",
          titleEnUS: "Publish Coupon",
          titleKz: "Купон шығару",
          titleRuRU: "Публикация купона",
        },
        component: () => import("../pages/manage_product/store_coupon/add.vue"),
      },
      {
        path: "/manage_product/store_coupon/detail",
        name: "店铺优惠券详情",
        meta: {
          title: "店铺优惠券详情",
          tabActive: "2",
          parent: "/manage_product/store_coupon",
          titleZhCN: "店铺优惠券详情",
          titleEnUS: "Store Coupon Details",
          titleKz: "Дүкен купоны егжей-тегжейі",
          titleRuRU: "Детали купона магазина",
        },
        component: () =>
          import("../pages/manage_product/store_coupon/detail.vue"),
      },
      {
        path: "/manage_product/point_setting",
        name: "积分抵现",
        meta: {
          title: "积分抵现",
          tabActive: "2",
        },
        component: () =>
          import("../pages/manage_product/point_setting/index.vue"),
      },
      {
        path: "/sysset_home/user",
        meta: {
          title: "权限管理",
          tabActive: "1",
        },
        component: () => import("../pages/sysset_home/user/index.vue"),
      },
      {
        path: "/sysset_home/powerGroup",
        name: "权限组管理",
        meta: {
          title: "权限组管理",
          tabActive: "1",
        },
        component: () => import("../pages/sysset_home/powerGroup/index.vue"),
      },
      {
        path: "/sysset_home/news",
        name: "消息管理",
        meta: {
          title: "消息管理",
          tabActive: "1",
        },
        component: () => import("../pages/sysset_home/news/index.vue"),
      },
      {
        path: "/decorate_pc/swiperManage",
        name: "轮播图管理",
        meta: {
          title: "轮播图管理",
          tabActive: "2",
        },
        component: () => import("../pages/decorate_pc/swiperManage/index.vue"),
      },
      {
        path: "/member/lists",
        name: "会员管理",
        meta: {
          title: "会员管理",
          tabActive: "3",
        },
        component: () => import("../pages/member/lists/index.vue"),
      },
      {
        path: "/member/point_setting",
        name: "积分设置",
        meta: {
          title: "积分设置",
          tabActive: "3",
        },
        component: () => import("../pages/member/point_setting/index.vue"),
      },
      {
        path: "/member/levelConfig",
        name: "会员等级管理",
        meta: {
          title: "会员等级管理",
          tabActive: "3",
        },
        component: () => import("../pages/member/levelConfig/index.vue"),
      },
      {
        path: "/manage_product/sellerManage",
        name: "商户管理",
        meta: {
          title: "商户管理",
          tabActive: "2",
        },
        component: () =>
          import("../pages/manage_product/sellerManage/index.vue"),
      },
      {
        path: "/manage_product/sellerManage/detail",
        name: "商户详情",
        meta: {
          title: "商户详情",
          tabActive: "2",
          parent: "/manage_product/sellerManage",
          titleZhCN: "商户详情",
          titleEnUS: "Merchant Details",
          titleKz: "Сатушы егжей-тегжейі",
          titleRuRU: "Детали продавца",
        },
        component: () =>
          import("../pages/manage_product/sellerManage/detail.vue"),
      },
      {
        path: "/manage_product/sellerManage/edit",
        name: "编辑商户",
        meta: {
          title: "编辑商户",
          tabActive: "2",
          parent: "/manage_product/sellerManage",
          titleZhCN: "编辑商户",
          titleEnUS: "Edit Merchant",
          titleKz: "Сатушыны өңдеу",
          titleRuRU: "Редактировать продавца",
        },
        component: () =>
          import("../pages/manage_product/sellerManage/edit.vue"),
      },
      {
        path: "/manage_product/sellerAnnualFee",
        name: "商户年费管理",
        meta: {
          title: "商户年费管理",
          tabActive: "2",
        },
        component: () =>
          import("../pages/manage_product/sellerAnnualFee/index.vue"),
      },
      {
        path: "/manage_product/cate_lists",
        name: "商户分类管理",
        meta: {
          title: "商户分类管理",
          tabActive: "2",
        },
        component: () => import("../pages/manage_product/cate_lists/index.vue"),
      },
      {
        path: "/manage_product/order_lists",
        name: "商品订单管理",
        meta: {
          title: "商品订单管理",
          tabActive: "2",
        },
        component: () =>
          import("../pages/manage_product/order_lists/index.vue"),
      },
      {
        path: "/manage_product/order_lists_detail",
        name: "订单详情",
        meta: {
          title: "订单详情",
          tabActive: "2",
          parent: "/manage_product/order_lists",
          titleZhCN: "订单详情",
          titleEnUS: "Order Details",
          titleKz: "Тапсырыс егжей-тегжейі",
          titleRuRU: "Детали заказа",
        },
        component: () =>
          import("../pages/manage_product/order_lists_detail/index.vue"),
      },
      {
        path: "/manage_product/reason",
        name: "原因管理",
        meta: {
          title: "原因管理",
          tabActive: "2",
        },
        component: () => import("../pages/manage_product/reason/index.vue"),
      },
      {
        path: "/manage_product/articleManage",
        name: "文章管理",
        meta: {
          title: "文章管理",
          tabActive: "2",
        },
        component: () =>
          import("../pages/manage_product/articleManage/index.vue"),
      },
      {
        path: "/manage_product/articleManage/edit",
        name: "编辑文章",
        meta: {
          title: "编辑文章",
          tabActive: "2",
          parent: "/manage_product/articleManage",
          titleZhCN: "编辑文章",
          titleEnUS: "Edit Article",
          titleKz: "Мақаланы өңдеу",
          titleRuRU: "Редактировать статью",
        },
        component: () =>
          import("../pages/manage_product/articleManage/edit.vue"),
      },
      {
        path: "/manage_product/feedback",
        name: "意见反馈",
        meta: {
          title: "意见反馈",
          tabActive: "3",
        },
        component: () => import("../pages/manage_product/feedback/index.vue"),
      },
      {
        path: "/manage_product/drawMoney",
        name: "提现管理",
        meta: {
          title: "提现管理",
          tabActive: "2",
        },
        component: () => import("../pages/manage_product/drawMoney/index.vue"),
      },
      {
        path: "/manage_product/service",
        name: "售后管理",
        meta: {
          title: "售后管理",
          tabActive: "2",
          keepAlive: true
        },
        component: () => import("../pages/manage_product/service/index.vue"),
      },
      {
        path: "/manage_product/service/detail",
        name: "退款详情",
        meta: {
          title: "退款详情",
          tabActive: "2",
          parent: "/manage_product/service",          
          titleZhCN: "退款详情",
          titleEnUS: "Refund Details",
          titleKz: "Қайтару егжей-тегжейі",
          titleRuRU: "Детали возврата",
        },
        component: () => import("../pages/manage_product/service/detail/index.vue"),
      },
      {
        path: "/manage_product/comment",
        name: "评论管理",
        meta: {
          title: "评论管理",
          tabActive: "2",
        },
        component: () => import("../pages/manage_product/comment/index.vue"),
      },
      {
        path: "/member/pointsAcquisitionRecord",
        name: "会员积分获取记录",
        meta: {
          title: "会员积分获取记录",
          tabActive: "3",
        },
        component: () =>
          import("../pages/member/pointsAcquisitionRecord/index.vue"),
      },
      {
        path: "/manage_product/settlementBill",
        name: "结算账单",
        meta: {
          title: "结算账单",
          tabActive: "2",
        },
        component: () =>
          import("../pages/manage_product/settlementBill/index.vue"),
      },
      {
        path: "/manage_product/settlementBill/detail",
        name: "结算详情",
        meta: {
          title: "结算详情",
          tabActive: "2",
          parent: "/manage_product/settlementBill",
          titleZhCN: "结算详情",
          titleEnUS: "Settlement Details",
          titleKz: "Есеп айырысу егжей-тегжейі",
          titleRuRU: "Детали расчета",
        },
        component: () =>
          import("../pages/manage_product/settlementBill/detail.vue"),
      },
      {
        path: "/manage_product/merchantApplication",
        name: "商家入驻管理",
        meta: {
          title: "商家入驻管理",
          tabActive: "2",
        },
        component: () =>
          import("../pages/manage_product/merchantApplication/index.vue"),
      },
      {
        path: "/manage_product/merchantApplication/config",
        name: "入驻配置管理",
        meta: {
          title: "入驻配置管理",
          tabActive: "2",
        },
        component: () =>
          import("../pages/manage_product/merchantApplication/config.vue"),
      },
      {
        path: "/manage_product/paymentRecord",
        name: "缴费记录",
        meta: {
          title: "缴费记录",
          tabActive: "2",
        },
        component: () =>
          import("../pages/manage_product/paymentRecord/index.vue"),
      },
      {
        path: "/manage_product/discountActivity",
        name: "折扣活动管理",
        meta: {
          title: "折扣活动管理",
          tabActive: "2",
        },
        component: () =>
          import("../pages/manage_product/discountActivity/index.vue"),
      },
      {
        path: "/sysset_home/system_log",
        name: "系统日志",
        meta: {
          title: "系统日志",
          tabActive: "0",
        },
        component: () =>
          import("../pages/sysset_home/system_log/index.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});
redirectUrl(router);
export default router;
